library evaluator;

abstract class ExpressWithEval {
  int get eval;
}

abstract class AdditionWithEval extends Expression {
  ExpressWithEval get operator1;
  ExpressWithEval get operator2;

  int get eval => operator1.eval + operator2.eval;
}

abstract class SubtractionWithEval {
  ExpressWithEval get operator1;
  ExpressWithEval get operator2;

  int get eval => operator1.eval - operator2.eval;
}

abstract class NumberWithEval {
  int get val;
  int get eval => val;
}

abstract class MultiplicationWithEval {
  ExpressWithEval get operator1;
  ExpressWithEval get operator2;

  int get eval => operator1.eval * operator2.eval;
}

/// ///////////////////////////////////////////////////////////////

class Expression {}
abstract class AbstractExpression {}

abstract class AbstractAddition {
  Expression operand1, operand2;

  AbstractAddition(this.operand1, this.operand2);
}

abstract class AbstractSubtraction {
  Expression operand1, operand2;
  AbstractSubtraction(this.operand1, this.operand2);
}

